package org.moonlight.jvm.classfile.attribute;

import lombok.Getter;
import org.moonlight.jvm.classfile.ClassReader;

/**
 * Exceptions是变长属性，记录方法抛出的异常表，其结构定义如下：
 *   Exceptions_attribute {
 *       u2 attribute_name_index;
 *       u4 attribute_length;
 *       u2 number_of_exceptions;
 *       u2 exception_index_table[number_of_exceptions];
 *   }
 *
 * @author Moonlight
 * @createTime 2023/8/15 16:54
 **/
@Getter
public class ExceptionsAttribute implements AttributeInfo {

    private int[] exceptionIdxTable;

    @Override
    public void readInfo(ClassReader reader) {
        this.exceptionIdxTable = reader.readUint16s();
    }

}
